<template>
  <div>
    {{props.person}}
    <el-button @click="emits('update', 'aasdd')">$emit</el-button>
  </div>
</template>
<script setup lang="ts">
defineOptions({
  name: 'info',
  inheritAttrs: false // 不继承父组件的props
})
interface CounterState {
  id: number
  name: string
}
// 相当于 vue2 中的 props 定义
const props = defineProps({
  person: {
    type: Object as PropType<{ name: string, age: number }>,
    require: true
  },
  arr: {
    type: Array as PropType<CounterState[]>,
    default: () => []
  }
})
// 相当于 vue2 中的 emits 定义
const emits = defineEmits(['update'])
</script>
